<?php

namespace app\common\validate;

use think\Validate;

class OrderValidate extends Validate
{
	/**
	 * 验证规则
	 * @var [array]
	 */
	protected $rule = [
       	'goodsId|商品id' => 'require',
       	'orderNo|订单号' => 'require',
       	'goodsPrice|商品价格' => 'require',
       	'number|数量' => 'require',
       	'remark|备注' => 'require',
        'type|支付类型' => 'require',
        'goodsProId|商品详情id' => 'require',
        'addressId|地址id' => 'require'
    ];

    /**
     * 创建订单
     * @Author   Yichen
     * @DateTime 2020-05-04T17:37:59+0800
     * @return   [type]                   [description]
     */
    public function sceneCreate()
    {
        return $this->only(['goodsProId', 'number', 'goodsPrice', 'type', 'addressId']);
    }

    /**
     * 核对
     * @Author   Yichen
     * @DateTime 2020-05-07T23:30:18+0800
     * @return   [type]                   [description]
     */
    public function sceneCheck()
    {
        return $this->only(['goodsProId']);
    }

}